/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package reprortes;

import Handlers.ProductHandler;
import apiAccess.APIEXception;
import java.io.IOException;
import java.util.List;
import org.xml.sax.SAXException;

/**
 *
 * @author w
 */
public class ReporteAdapter implements ProductLister {

    Reporte reporte;
    List<Integer> idList;
    List<String> nameList;

    public ReporteAdapter(Reporte reporte) throws SAXException, IOException, APIEXception{
        this.reporte=reporte;
        idList=reporte.getFirst(10);
        nameList=(new ProductHandler(0, idList)).getProductNameList();
    }
    
     public List<Integer> productList(){
        return idList;
    }

    public String number(int n){
        return reporte.times(idList.get(n))+ "times";
    }

    public String name(int n){
        return nameList.get(n);
    }

    public int size(){
        return idList.size();
    }
}
